import { http } from "../http";

export const funLogin = (adminname,password) => http({
    url:"/admin/login",
    method:"post",
    data: {
        adminname,
        password,
    },
})

/**
 * 获取管理员列表信息
 * @returns {Promise} 获取管理员列表信息
 */
export const getAdminList = () =>
  http({
    url: "/admin/list",
  });

  export const deleteAdmin = (adminid) =>
  http({
    url: "/admin/delete",
    method: "post",
    data: {
      adminid,
    },
  });
  export const addAdmin = (adminname,password,role) =>
  http({
    url: "/admin/add",
    method: "post",
    data: {
      adminname,password,role
    },
  });
  export const editAdmin = (adminname,role) =>
  http({
    url: "/admin/update",
    method: "post",
    data: {
      adminname,role
    },
  });